export default {
    showDialog: false,
    pageOption: {},
    formAttr: [
        {field: 'name', label: '姓名', type: 'input', alert: '初始密码为888888', disabled: true, required: true},
        {field: 'username', label: '用户名', type: 'input'},
        {field: 'password', label: '密码', type: 'password'},
        {
            field: 'status', label: '状态', type: 'radio',
            children: [
                {value: 0, label: '禁用'},
                {value: 1, label: '正常'},
            ]
        }
    ],
    defaultData: {
        name: 'max',
        status: 1
    },
    tableData: [
        { id: 1, name: '张三', username: 'zhangsan', phone: '18709581727', avatar: '/favicon.ico', status: '0',
            income: 231.67, expend: 6543.00,
            roles: [{id: 1, name: '超级管理员'}],
            createTime: '2022-06-08T21:35:33'
        },
        { id: 2, name: '李四', username: 'lisi', phone: '18709581727', avatar: '/favicon.ico', status: '1',
            income: 2311.67, expend: 833.01,
            roles: [ {id: 2, name: '管理员'} ],
            createTime: '2022-06-08T21:35:33',
            // view/edit/delete为false时禁用按钮，默认为true
            handle: {view: false, edit: false}
        }
    ],
    tableAttr: [
        /**
         * type为avatar时显示头像
         */
        {type: 'avatar', field: 'avatar', label: '头像', width: '50'},
        {field: 'name', label: '姓名', width: '120', header: 'input'},
        {field: 'username', label: '用户名', header: 'input'},
        {label: '金额',
            children: [
                {field: 'income', label: '收入', sortable: true, width: 80},
                {field: 'expend', label: '支出', sortable: true, width: 80}
            ]
        },
        /**
         * type为tags时显示多个标签
         * header为filter时表头开启筛选，必须有options选项
         */
        {type: 'tags', field: 'roles', label: '角色', header: 'select',
            options: [
                {value: '1', label: '超级管理员'},
                {value: '2', label: '管理员'},
            ]
        },
        /**
         * header为search时表头开启搜索功能
         */
        {field: 'phone', label: '手机号', sortable: true, header: 'input'},
        /**
         * type为tag时显示单个标签
         * header为filter时表头开启筛选，必须有options选项
         */
        {type: 'tag', field: 'status', label: '状态', header: 'select',
            options: [
                {value: '0', label: '禁用', type: 'danger'},
                {value: '1', label: '正常', type: 'success'},
            ]
        },
        {field: 'createTime', label: '创建时间', header: 'daterange', width: 250},
        /**
         * 当type为handle时显示操作列
         */
        {type: 'handle', field: 'handle', label: '操作', fixed: 'right', header: 'search', width: 140,
            handle: {
                edit: { label: '编辑', type: 'text', size: 'small'},
                delete: { label: '删除'}
            }
        }
    ]
}